<nav class="bar bar-tab">
    <a class="tab-item external tab-1" href="./">
        <span class="icon tab-1-1"><img class="bottom_icon" src="images/bottom_1.png"></span>
        <span class="tab-label">首页</span>
    </a>
    <a class="tab-item external tab-2" href="<{link app=b2c ctl=wap_gallery act=cat}>">
        <span class="icon tab-2-1"><img class="bottom_icon" src="images/bottom_2.png"></span>
        <span class="tab-label">分类</span>
    </a>
    <a class="tab-item external tab-5" href="<{link app=b2c ctl=wap_product act=scanner_qrcode}>">
        <span class="icon tab-5-1"><img class="bottom_icon" src="images/bottom_7.png"></span>
        <span class="tab-label">查询</span>
    </a>
    <a class="tab-item external tab-3" href="<{link app=b2c ctl=wap_cart act=index}>">
        <span class="icon tab-3-1"><img class="bottom_icon" src="images/bottom_3.png"></span>
        <span class="tab-label">购物车</span>
    </a>
    <a class="tab-item external tab-4" href="<{link app=b2c ctl=wap_member act=index}>">
        <span class="icon tab-4-1"><img class="bottom_icon" src="images/bottom_4.png"></span>
        <span class="tab-label">我的</span>
    </a>
</nav>
<div class="bar bar-header-secondary nav_top_bg">
    <div class="top_icon">
        <img class="top_icon_a" src="images/top_scan.png" onclick="document.location='<{link app=b2c ctl=wap_gallery act=cat}>';">
        <img class="top_icon_b" src="images/top_news.png" onclick="document.location='http://kefu.easemob.com/webim/im.html?tenantId=44790'" >
    </div>
    <div class="searchbar">
        <!-- <a class="searchbar-cancel">取消</a> -->
        <div class="search-input">
            <form class="a-search" action="<{link app=b2c ctl=wap_search act=result}>" method="post" id="J_search_pt">
            <label class="icon icon-search" for="search" style="color: #d1bb7f;"></label>
            <input type="search" class="a-search-ipt" id='search' name="search_keywords" placeholder='搜索您需要的商品' />
                <img src="images/scaner.png" alt=""  class="top_icon_c" onclick="document.location='<{link app=b2c ctl=wap_product act=scanner_qrcode}>';">
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        var url = location.href;
        if (url.indexOf('/gallery-cat.html')>0||url.indexOf('/product-arrival')>0) {
            $('.tab-2').addClass('active');
            var html = '<img class="bottom_icon" src="images/bottom_now_2.png">';
            $('.tab-2-1').html(html);
        }
        var length = url.length;
        if (url.substring(length,length-4)=='wap/') {
            $('.tab-1').addClass('active');
            var html = '<img class="bottom_icon" src="images/bottom_now_1.png">';
            $('.tab-1-1').html(html);
        }
        if (url.indexOf('/passport.html')>0||url.indexOf('/member.html')>0) {
            $('.tab-4').addClass('active');
            var html = '<img class="bottom_icon" src="images/bottom_now_4.png">';
            $('.tab-4-1').html(html);
        }
        if (url.indexOf('/cart.html')>0) {
            $('.tab-3').addClass('active');
            var html = '<img class="bottom_icon" src="images/bottom_now_3.png">';
            $('.tab-3-1').html(html);
        }
    })
    $('.icon-search').on('tap',function(){
        var prt = $(this).parent();
        prt.submit();
    });
    $('#J_search_pt').on('submit',function(){
        if($.trim($(this).find('.a-search-ipt').val()) == ''){
            return false;
        }
    });
</script>